#!/bin/bash
# filename:running.sh
# run_down_gdgg，新闻每天定时重启
# 查询 是否含有进程 down_ppt ，如果存在就杀掉！然后重启
# nohup bash run_down_china_cnr.sh >bash.log &

seconds=86400
echo $seconds
while true
do
  echo $i
  str=`ps aux | grep "china_cnr_gdgg.py" | grep -v grep | awk '{print $2}'`
  echo $str Manager
  kill -9 $str
  if [ "$?" -eq 0 ]; then
      echo "kill success"
  else
      echo "kill failed"
  fi
#/home/chenglei3/work/python_spider/venv/bin/
  nohup /home/chenglei3/work/python_spider/venv/bin/python3.8  china_cnr_gdgg.py >nohup_down_gdgg.txt 2>&1 &
  nohup /home/chenglei3/work/python_spider/venv/bin/python3.8  china_cnr_erwen.py >nohup_down_erwen.txt 2>&1 &

  sleep  ${seconds}
done
